<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <script src="js/zy_control.js"></script>
        <script src="js/zy_click.js"></script>
        <script src="js/jquery-1.8.3.min.js"></script>
        <script src="js/main.js"></script>
        <script src="js/common.js"></script>
		<script src="js/talkingdata.js"></script>
        <style>
            .bgi {
                background-image: url(images/bcImage.png)
            }
             .return {
                background-image: url('images/delaySchedule1.png');
                height: 1.25em;
                width: 1.25em;
            }
            .t-wh
            {
                color:white;
            }
            .nav-btn {
                min-height: 2em;
                min-width: 4em;
                display: -webkit-box !important;
                display: box !important;
                position: relative;
                -webkit-box-align: center;
                box-align: center;
                -webkit-box-pack: center;
                box-pack: center;
            }
        </style>
    </head>
    <body class="um-vp " ontouchstart>
       <div id="content" class="ub-f1 tx-l">
            <div style="margin: 0.4em" class="ub ub-ver">
                     <div class="ub ub-pc ub-ac" style="margin-top: 1.2em;margin-bottom: 1.2em">
                    <div style="width: 50%" class="ub ub-pc ub-ac">
                        <!--canvas id="myCanvas1" width="130" height="195"></canvas-->
                        <div style="border: 4px solid #f68863;border-radius: 100%;height: 5.2em;width: 5.2em;color: #FFFFFF" class="ub ub-ac ub-pc ub-ver">
                            <div id="chaoshounum"></div>
                            <div style="font-size: 0.8em" id="hangzhan">月厦门航站</div>
                            <div style="font-size: 0.8em">共计超售</div>
                        </div>
                    </div>
                    <div style="width: 50%" class="ub ub-pc ub-ac">
                        <!--canvas id="myCanvas2" width="130" height="195"></canvas-->
                        <div style="border: 4px solid #afdcfb;border-radius: 100%;height: 5.2em;width: 5.2em;color: #FFFFFF" class="ub ub-ac ub-pc ub-ver">
                             <div id="cost"></div>
                            <div style="font-size: 0.8em;">共赔偿</div>
                            <div style="font-size: 0.8em">人民币金额</div>
                        </div>
                    </div>
                </div>
                <div class="ub-ver" style="color: #36395c;width: 100%">
                    <div style="font-weight: bold;" class="ub">
                        <div style="background-color:rgba(255,255,255,0.2);border: 1px solid rgba(255,255,255,0.1);height: 1.6em;width: 25.5%;margin-right: 0.1em" class="ub-ac ub-pc ub ub-f1">
                            日期
                        </div>
                        <div style="background-color:rgba(255,255,255,0.6);border: 1px solid rgba(255,255,255,0.6);height: 1.6em;width: 20.1%;margin-right: 0.1em" class="tx-c ub ub-f1 ub-ac ub-pc">
                            航班号
                        </div>
                        <div style="background-color:rgba(255,255,255,0.6);border: 1px solid rgba(255,255,255,0.6);height: 1.6em;width: 32%;margin-right: 0.1em" class="tx-c ub ub-f1 ub-ac ub-pc">
                            航线
                        </div>
                        <div style="background-color:rgba(255,255,255,0.6);border: 1px solid rgba(255,255,255,0.6);height: 1.6em;width: 23%;" class="tx-c ub ub-f1 ub-ac ub-pc">
                            超售数量
                        </div>
                    </div>
                    <div id="chaoshou"></div>
                   
                   
                </div>
            </div>
       
            </div>
            <!--content结束-->
    </body>
    <script>
        zy_init();
        window.uexOnload = function(type) {
            if (!type) {
				IC.talkingDataCount("超售情况","0022");
               //点击设备返回键时则退出子应用
                uexWindow.setReportKey(0, 1);
                uexWindow.onKeyPressed = function(keyCode){
                    if (keyCode == 0){
                         uexWidget.finishWidget('1');
                    } 
                }
                openDate();
                getsubmit();
            
            }
        }
        function closeWidget(){
			IC.talkingDataCount("超售情况","0022");
            uexWidget.finishWidget('1');
        }
        function openDate(){
			IC.talkingDataCount("超售情况","0022");
            var date= new Date();
            var month = checkDate(date.getMonth() + 1);
             document.getElementById("hangzhan").innerHTML = month +"月"+"虹桥"+"航站";  
        }
        function checkDate(date){
                if(date <　10){
                   date= "0" + date;
                }
                return date;
        }
        function  getsubmit(){
			IC.talkingDataCount("超售情况","0022");
            var date= new Date();
            var ym = date.getFullYear() +"-"+ checkDate(date.getMonth() + 1);
            var takeoffThree =localStorage.getItem("Default_IATACode");
            if(takeoffThree=="undefined"){
                takeoffThree="SHA";
            }
            var param = {"triggerOverbooking.takeoffThree":takeoffThree,"triggerOverbooking.datetimes":ym};
            jQuery.ajax({
                url :yddfProUrl+"addOverbooking_queryTriggerOverbooking.action",
                type : "POST",
                data : param,
                dataType : "text",
                success : function(data) {
                    var dataStr = JSON.parse(data);
                    var arry= dataStr.arry;
                    var tempHtml = "";
                    var overbookingSum=0;
                    var amountMoneySum=0;
                   for (var i = 0; i < arry.length; i++) {
                        var d = arry[i];
                        var contentId = d.id;
                        var datatimes=d.datetimes.substr(0, 10);
                        var carrier=d.carrier;
                        var flightno=d.flightno;
                        var takeoffAirport=d.takeoffAirport;
                        var landingAirport=d.landingAirport;
                        var overbookingNum=Number(d.overbookingNum);
                        var amountMoney=Number(d.amountMoney);
                        overbookingSum += overbookingNum;
                        amountMoneySum += amountMoney;
                        //alert(amountMoney);
                        tempHtml +='<div  style="width: 100%;margin-top: 0.1em" class="ub">'
                            +'<div style="background-color:#fee3ce;border: 1px solid rgba(255,255,255,0.2);font-size: 0.8em;width: 25%;margin-right: 0.1em" class="ub ub-pc ub-ac tx-c" id="datetimes'+contentId+'">'
                               +datatimes
                           +' </div>'
                            +'<div style="border: 1px solid rgba(255,255,255,0.6);width: 20%;margin-right: 0.1em" class="ub ub-pc ub-ac ub-f1" id="flightno'+contentId+'">'
                               +carrier+flightno
                            +'</div>'
                            +'<div style="border: 1px solid rgba(255,255,255,0.6);width: 32%;margin-right: 0.1em;font-size:0.75em" class="ub ub-pc ub-ac ub-f1" id="airline'+contentId+'">'
                               +takeoffAirport+'-'+landingAirport
                            +'</div>'
                            +'<div style="border: 1px solid rgba(255,255,255,0.6);width: 23%" class="ub ub-pc ub-ac ub-f1" id="overbookingNum'+contentId+'">'
                               +overbookingNum
                            +'</div>'
                        +'</div>'
                        $$("chaoshou").innerHTML = tempHtml;
                    }
                $$("chaoshounum").innerHTML = overbookingSum+"人";
                $$("cost").innerHTML = amountMoneySum+"元";
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) { 
                        alert("数据请求失败！"); 
                } 
            });     
        }

    </script>
</html>